Using a "type library" (TLB) with Explorer

Be aware, this is a complicated example.  Someone not familiar and proficient with Delphi will 
probably have some problems.

============= INTRODUCTION =========================
The resulting program is a demonstration showing how to enable serial port control using Turbo Delphi 
Explorer with a TYPE LIBRARY (TLB). It is NOT a full featured CAT control program. As 
configured, the resulting software will read and set transceiver receive frequency and mode for several 
radios.  It uses the TYPE LIBRARY OmniRig to provide serial port and CAT functions for numerous radios including ICOM, Kenwood, Ten-Tec, Yaesu etc.

Before running the program, you must load and install the OmniRig COM control (see the article to 
find out how to get this helper program).  This example program links to this control that you must install seperately.

The the port settings for this software example  are saved using the OmniRig utility from one session to another.  The example does not self-start on loading.  It could be made to do this using an INI file or a simple text file -examples are available on the Web. The is commented and 
is written so individual steps in the process can be examined.  Omnirig activities 
are displayed in a Memo control as the program executes.

The source code  is commented.


73,
Steve, WB5KIA


============= USING THE TLB ====
Do not load Explorer; it will self load after one of the following steps:

1) You need to do some prelimnary work before you can use this source code.

2) Load the Omni-Rig program on your PC.  Doing so registers the ocx that is the basis 
for the TLB with Windows.


3) You need to add some files to the Explorer folders.

As written, the catcomplicated source code looks for the Omni-Rig type library in
h:\program files\borland\bds\4.0\Imports\OmniRig_TLB.pas

In your case it won't be there and you will have to put the OmniRig_TLB.pas file and other files in a logical location.   for example c:\\program files\borland\bds\4.0\Imports\

4) Put the three files you will find in the Omni-Rig Files for Explorer TLB folder in
the Imports folder of Explorer (OmniRig_TLB.dcr; OmniRig_TLB.pas, Omnirig_TLB.dcu).

5) Now you can go to the QEX download catcomplicated folder.  Find the file catcomplicated.bdsproj
and double click on it.  Doubleclicking will load the source code and start Turbo Delphi Explorer..
it takes a few seconds to load so be patient.

6) After the program loads, from the Explorer's main tool bar, go to RUN>RUN.

This should start the program coding example compiling.

If the code does not work, it is most likely that the program could not find the files needed.
Go to the Explorer main menu bar and Project>Add to Project   and select OmniRig_TLB.pas

Now rerun RUN>RUN

If this fails to work, there may be a path problem (Explorer cannot find the OmniRig_TLB.pas file).


If all the above fails you may have to "install" OmniRig as a Type library using the main menu toolbar 
Component> Install Component and selecting on Import a type library.  Then next.  From 
the list (If you have already installed OmniRig) select "OmniRig Library, Version 1.0, C:\PROGRA~1\Afreet\Omni-Rig\OmniRig.exe"  (this is the address that OmniRig will install 
to if you use the default location).  NEXT.  Put this in the Unit Directory box:  
c:\program files\borland\bds\4.0\Imports\     and check the path.   Then click NEXT  and 
check create unit and then FINISH    

It also might be possible to use the files in the "Omni-Rig files for Explorer TLB" folder.  These are the TLB files "precompiled" using my version of Explorer.  You will still have to load the Omni-Rig
software as the compiled program requires it for its operation.

